const ws = new WebSocket('ws://localhost:8765');
ws.onopen = function() {
    console.log('WebSocket连接已打开');
    // 可以在这里发送消息给Electron主进程
    // ws.send('Hello from web page!');
};

ws.onmessage = (event) => {
    console.log('received: ' + event.data);
    // 处理收到的消息

};

ws.onclose = function() {
    console.log('WebSocket连接已关闭');
};

export default ws

